<!--Descriptive page name, messages and instructions-->
<h2>User invite requests</h2>

<p>Enter "0" under quantity to deny the request. Clear the box to delay your decision for now.</p>
<!--/descriptions-->

<!--main content-->
<%= form_tag url_for(:controller => 'user_invite_requests', :action => 'update') do %>
<table summary="This table shows requests from users for invites, with their given reasons. You can allot invites to individuals under the heading Quantity">
  <caption>Allot invites to users</caption>
  <thead>
    <tr>
        <th scope="col">User</th>
        <th scope="col">Reason</th>
        <th scope="col">Quantity</th>
        <th scope="col">Created at</th>
        <th scope="col">Previous</th>
      </tr>
  </thead>
    <tbody>
  <% @user_invite_requests.each do |request| %>
      <tr>
        <td><%= link_to request.user.login, request.user %></td>
        <td><%=h request.reason %></td>
        <td><%= text_field_tag "requests[#{request.id}]", request.quantity, :size => 2, :id => "requests[#{request.user.login}]" %></td>
        <td><%=h request.created_at %>
        <td><%= link_to_previous_invite_requests(request) %></td>
      </tr>
  <% end %>
  </tbody>
  <tfoot>
    <tr>
      <th scope="row" colspan="4">Submit:</th>
      <td class="submit"><%= submit_tag "Update" %></td>
    </tr>
  </tfoot>
</table>
<% end %>
<!--/content-->